import { HeaderData } from "@/model/AxiosModel.ts";

/**
 * 添加自定义请求头
 * @param headers
 */
const addCustomHeaders = (headers: HeaderData) => {
    //1 遍历参数headers为空的属性,赋值默认值
    for (let key in headers) {
        if (headers[key] === undefined) {
            headers[key] = "true";
        }
        if (headers[key] === null) {
            headers[key] = "true";
        }
        if (headers[key] === true) {
            headers[key] = "true";
        }
        if (headers[key] === false) {
            headers[key] = "false";
        }
    }


    return headers;
};